import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import login from '@/login'
import register from '@/register'
import main from '@/mainview/main'

//导入主页面组件
import auManage from '@/mainview/authorizationManage/authorizationManage'
import basicInfo from '@/mainview/personalSetting/basicInfo'
import detailedInfo from '@/mainview/personalSetting/detailedInfo'
import groupPortrait from '@/mainview/portraitAnalysis/groupPortrait'
import personalPortrait from '@/mainview/portraitAnalysis/personalPortrait'
import listShow from '@/mainview/userList/listShow'
import tagSearching from '@/mainview/userList/tagSearching'
import similarUser from '@/mainview/userList/similarUser'
import goodsRecommend from '@/mainview/userList/goodsRecommend'
import areaAnalysis from '@/mainview/userList/areaAnalysis'

import search from '@/components/search'


Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/register',
      name: 'register',
      component: register
    },
    {
      path: '/main',
      name: 'main',
      component: main,
      children: [
        {
          path: '/personalInfo/basicInfo',
          name: '基础信息',
          component: basicInfo,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/personalInfo/detailedInfo',
          name: '详细信息',
          component: detailedInfo,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/userList/listShow',
          name: '用户列表',
          component: listShow,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/userList/tagSearching',
          name: '标签查询',
          component: tagSearching,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/userList/similarUser',
          name: '查询相似用户',
          component: similarUser,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/userList/goodsRecommend',
          name: '商品推荐',
          component: goodsRecommend,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/userList/areaAnalysis',
          name: '地区分析',
          component: areaAnalysis,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/portraitShow/personalPortrait',
          name: '个人用户画像展示',
          component: personalPortrait,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/portraitShow/groupPortrait',
          name: '群体用户画像展示',
          component: groupPortrait,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/authorizationManage/auManage',
          name: '权限管理',
          component: auManage,
          meta: {
            requireAuth: true
          }
        },


      ]
    },
    {
      path: '/search',
      name: 'search',
      component: search
    }

  ]
})
